package com.siashan.unipay4j.wx.sdk;

import org.apache.http.client.HttpClient;

/**
 * 常量
 * @author siashan
 * @since v1.0.1
 */
public class WXPayConstants {

    public enum SignType {
        MD5, HMACSHA256
    }

    public static final String DOMAIN_API = "api.mch.weixin.qq.com";
    public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
    public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
    public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";


    public static final String FAIL = "FAIL";
    public static final String SUCCESS = "SUCCESS";
    public static final String HMACSHA256 = "HMAC-SHA256";
    public static final String MD5 = "MD5";
    public static final String UTF_8 = "utf-8";

    public static final String FIELD_SIGN = "sign";
    public static final String FIELD_SIGN_TYPE = "sign_type";

    public static final String WXPAYSDK_VERSION = "WXPaySDK/3.0.9";
    public static final String USER_AGENT = WXPAYSDK_VERSION +
            " (" + System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") +
            ") Java/" + System.getProperty("java.version") + " HttpClient/" + HttpClient.class.getPackage().getImplementationVersion();

    public static final String MICROPAY_URL_SUFFIX = "/pay/micropay";
    public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
    public static final String ORDERQUERY_URL_SUFFIX = "/pay/orderquery";
    public static final String REVERSE_URL_SUFFIX = "/secapi/pay/reverse";
    public static final String CLOSEORDER_URL_SUFFIX = "/pay/closeorder";
    public static final String REFUND_URL_SUFFIX = "/secapi/pay/refund";
    public static final String REFUNDQUERY_URL_SUFFIX = "/pay/refundquery";
    public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
    public static final String DOWNLOADFUNDFLOW_URL_SUFFIX = "/pay/downloadfundflow";
    public static final String REPORT_URL_SUFFIX = "/payitil/report";
    public static final String SHORTURL_URL_SUFFIX = "/tools/shorturl";
    public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";
    public static final String MMPAYMKTTRANSFERS_TRANSFERS_URL_SUFFIX = "/mmpaymkttransfers/promotion/transfers";
    public static final String MMPAYMKTTRANSFERS_GETTRANSFERINFO_URL_SUFFIX = "/mmpaymkttransfers/gettransferinfo";
    public static final String MMPAYMKTTRANSFERS_PAY_BANK_URL_SUFFIX = "/mmpaysptrans/pay_bank";
    public static final String MMPAYMKTTRANSFERS_QUERY_BANK_URL_SUFFIX = "/mmpaysptrans/query_bank";
    public static final String MMPAYMKTTRANSFERS_SENDREDPACK_URL_SUFFIX = "/mmpaymkttransfers/sendredpack";
    public static final String MMPAYMKTTRANSFERS_SENDGROUPREDPACK_URL_SUFFIX = "/mmpaymkttransfers/sendgroupredpack";
    public static final String MMPAYMKTTRANSFERS_SENDMINIPROGRAMHB_URL_SUFFIX = "/mmpaymkttransfers/sendminiprogramhb";
    public static final String MMPAYMKTTRANSFERS_GETHBINFO_URL_SUFFIX = "/mmpaymkttransfers/gethbinfo";
    public static final String PAY_PROFITSHARINGADDRECEIVER_URL_SUFFIX = "/pay/profitsharingaddreceiver";
    /**
     * 分账-请求单次分账
     */
    public static final String PROFITSHARING_URL_SUFFIX = "/secapi/pay/profitsharing";
    /**
     * 分账-请求多次分账
     */
    public static final String MULTIPROFITSHARING_URL_SUFFIX = "/secapi/pay/multiprofitsharing";
    /**
     * 分账-查询分账结果
     */
    public static final String PROFITSHARINGQUERY_URL_SUFFIX = "/pay/profitsharingquery";


    /**
     * sandbox
    */
    public static final String SANDBOX_MICROPAY_URL_SUFFIX = "/sandboxnew/pay/micropay";
    public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
    public static final String SANDBOX_ORDERQUERY_URL_SUFFIX = "/sandboxnew/pay/orderquery";
    public static final String SANDBOX_REVERSE_URL_SUFFIX = "/sandboxnew/secapi/pay/reverse";
    public static final String SANDBOX_CLOSEORDER_URL_SUFFIX = "/sandboxnew/pay/closeorder";
    public static final String SANDBOX_REFUND_URL_SUFFIX = "/sandboxnew/secapi/pay/refund";
    public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX = "/sandboxnew/pay/refundquery";
    public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
    public static final String SANDBOX_DOWNLOADFUNDFLOW_URL_SUFFIX = "/sandboxnew/pay/downloadfundflow";
    public static final String SANDBOX_REPORT_URL_SUFFIX = "/sandboxnew/payitil/report";
    public static final String SANDBOX_SHORTURL_URL_SUFFIX = "/sandboxnew/tools/shorturl";
    public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";
    public static final String SANDBOX_MMPAYMKTTRANSFERS_TRANSFERS_URL_SUFFIX = "/sandboxnew/mmpaymkttransfers/promotion/transfers";
    public static final String SANDBOX_MMPAYMKTTRANSFERS_GETTRANSFERINFO_URL_SUFFIX = "/sandboxnew/mmpaymkttransfers/gettransferinfo";
    public static final String SANDBOX_MMPAYMKTTRANSFERS_PAY_BANK_URL_SUFFIX = "/sandboxnew/mmpaysptrans/pay_bank";
    public static final String SANDBOX_MMPAYMKTTRANSFERS_QUERY_BANK_URL_SUFFIX = "/sandboxnew/mmpaysptrans/query_bank";
    public static final String SANDBOX_SUFFIX = "/sandboxnew";


    //******************************************* V3 接口请求地址 *****************************************************//

    /**
     * V3 jsapi支付 接口地址
     */
    public static final String V3_PAY_URL_JSAPI = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi";
    /**
     * V3 h5支付 接口地址
     */
    public static final String V3_PAY_URL_H5 = "https://api.mch.weixin.qq.com/v3/pay/transactions/h5";
    /**
     * V3 app支付 接口地址
     */
    public static final String V3_PAY_URL_APP = "https://api.mch.weixin.qq.com/v3/pay/transactions/app";
    /**
     * V3 native支付 接口地址
     */
    public static final String V3_PAY_URL_NATIVE = "https://api.mch.weixin.qq.com/v3/pay/transactions/native";
    /**
     * V3 交易关闭 接口地址
     */
    public static final String V3_PAY_URL_CLOSE = "https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}/close";
    /**
     * V3 支付结果查询 接口地址（按微信交易订单号查询）
     */
    public static final String V3_PAY_URL_QUERY_BY_TRANSACTION_ID = "https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}";
    /**
     * V3 支付结果查询 接口地址（按平台交易单号查询）
     */
    public static final String V3_PAY_URL_QUERY_BY_OUTTRADE_NO = "https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}";
    /**
     * V3 申请退款 接口地址
     */
    public static final String V3_PAY_URL_REFUND = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds";
    /**
     * V3 查询单笔退款 接口地址
     */
    public static final String V3_PAY_URL_REFUND_QUERY = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/{out_refund_no}";
    /**
     * V3 申请交易账单 接口地址
     */
    public static final String V3_PAY_URL_TRADEBILL = "https://api.mch.weixin.qq.com/v3/bill/tradebill";
    /**
     * V3 申请资金账单  接口地址
     */
    public static final String V3_PAY_URL_FUNDFLOWBILL = "https://api.mch.weixin.qq.com/v3/bill/fundflowbill";
    /**
     * V3 创建投诉通知回调
     */
    public static final String V3_PAY_URL_CREATE_COMPLAINT_NOTIFICATIONS = "https://api.mch.weixin.qq.com/v3/merchant-service/complaint-notifications";
    /**
     * V3 商家转账到零钱
     */
    public static final String V3_PAY_URL_TRANSFER_BATCHES = "https://api.mch.weixin.qq.com/v3/transfer/batches";
    /**
     * V3 商家转账到零钱-新版
     */
    public static final String V3_PAY_URL_TRANSFER_BillS = "https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills";
    /**
     * V3 商家转账到零钱-撤销
     */
    public static final String V3_PAY_URL_TRANSFER_CANCEL = "https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}/cancel";
    /**
     *  V3 商家转账到零钱-查询
     */
    public static final String V3_PAY_URL_TRANSFER_QUERY_OUT_BILL_NO = "https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}";
    /**
     * V3 商家转账到零钱-查询
     */
    public static final String V3_PAY_URL_TRANSFER_QUERY_TRANS_BILL_NO = "https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/{transfer_bill_no}";



    //**********************************************  报文常量  *******************************************************//
    /**
     * 返回状态码
     */
    public static final String RETURN_CODE = "return_code";
    /**
     *返回信息
     */
    public static final String RETURN_MSG = "return_msg";
    /**
     * 业务结果
     */
    public static final String RESULT_CODE = "result_code";
    /**
     * 错误代码
     */
    public static final String ERR_CODE = "err_code";
    /**
     * 错误代码描述
     */
    public static final String ERR_CODE_DES = "err_code_des";
    /**
     * 转账状态、代付单状态
     */
    public static final String STATUS = "status";

    /**
     * 支付状态
     */
    public static final String TRADE_STATE = "trade_state";

    public static final String CODE = "code";
    public static final String MESSAGE = "message";

}

